package com.miracle9.game.dao;
import com.miracle9.game.entity.JoyRoom;
import org.hibernate.Query;
import org.springframework.stereotype.Repository;

@Repository
public class JoyRoomServiceDao extends SqlOperating<JoyRoom, Integer>
{
  public JoyRoom getById(int id)
  {
    return (JoyRoom)getById(Integer.valueOf(id));
  }
  
  public void updateDeskNumByModeId(int deskNum, int nModeId)
  {
    String hql = "update JoyRoom set deskNum = deskNum + ? where modeId = ?";
    q_CreateSql(hql, new Object[] { Integer.valueOf(deskNum), Integer.valueOf(nModeId) }).executeUpdate();
  }
}
